package model

import "github.com/gogf/gf/v2/os/gtime"

type ArticleListInput struct {
	Recycle    bool   `json:"recycle" in:"query" v:"boolean"`
	CategoryId string `json:"category_id" in:"query" v:"integer|min:1" dc:"分类ID"`
	Keywords   string `json:"keywords" in:"query"`
	Status     string `json:"status" in:"query" v:"integer|in:0,1"`
	PageSizeReq
}

type ArticleListItem struct {
	Id            uint64      `json:"id"`
	CoverImage    string      `json:"cover_image" dc:"封面图片"`
	ArticleTitle  string      `json:"article_title" dc:"文章标题"`
	ArticleSort   uint        `json:"article_sort" dc:"排序"`
	ArticleStatus uint        `json:"article_status" dc:"文章状态：0-未发布、1-已发布"`
	PublishAt     *gtime.Time `json:"publish_at" dc:"发布时间"`
	DeletedAt     *gtime.Time `json:"deleted_at" dc:"删除时间"`
	IsTop         uint        `json:"is_top" dc:"是否置顶：0-否、1-是"`
	ViewCount     uint64      `json:"view_count" dc:"阅读数"`
	LikeCount     uint64      `json:"like_count" dc:"点赞数"`
}

type ArticleItem struct {
	Id             uint64      `json:"id"`
	CategoryId     uint64      `json:"category_id" dc:"分类ID"`
	CoverImage     string      `json:"cover_image" dc:"封面图片"`
	ArticleTitle   string      `json:"article_title" dc:"文章标题"`
	ArticleDesc    string      `json:"article_desc" dc:"文章描述"`
	ArticleAuthor  string      `json:"article_author" dc:"作者"`
	ArticleSource  string      `json:"article_source" dc:"来源"`
	ArticleLink    string      `json:"article_link" dc:"链接"`
	ArticleSort    uint        `json:"article_sort" dc:"排序"`
	ArticleStatus  uint        `json:"article_status" dc:"文章状态：0-未发布、1-已发布"`
	PublishAt      *gtime.Time `json:"publish_at" dc:"发布时间"`
	IsTop          uint        `json:"is_top" dc:"是否置顶：0-否、1-是"`
	TagsIds        []uint64    `json:"tags_ids" dc:"标签id集合"`
	ArticleContent string      `json:"article_content" dc:"内容"`
}

type ArticleFormInput struct {
	CategoryId     uint64      `json:"category_id" v:"required|integer|min:1" dc:"分类ID"`
	CoverImage     string      `json:"cover_image" v:"max-length:200" dc:"封面图片"`
	ArticleTitle   string      `json:"article_title" v:"required|max-length:30" dc:"文章标题"`
	ArticleDesc    string      `json:"article_desc" v:"max-length:150" dc:"文章描述"`
	ArticleAuthor  string      `json:"article_author" v:"max-length:30" dc:"作者"`
	ArticleSource  string      `json:"article_source" v:"max-length:30" dc:"来源"`
	ArticleLink    string      `json:"article_link" v:"url|max-length:200" dc:"链接"`
	ArticleSort    uint        `json:"article_sort" v:"integer|between:0,1000" dc:"排序"`
	ArticleStatus  uint        `json:"article_status" v:"integer|in:0,1" dc:"文章状态：0-未发布、1-已发布"`
	PublishAt      *gtime.Time `json:"publish_at" v:"date" dc:"发布时间"`
	IsTop          uint        `json:"is_top" v:"integer|in:0,1" dc:"是否置顶：0-否、1-是"`
	TagsIds        []uint64    `json:"tags_ids" v:"array" dc:"标签id集合"`
	ArticleContent string      `json:"article_content" dc:"内容"`
}
